package models;

import java.util.Calendar;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;

import play.data.validation.Unique;
import play.db.jpa.Model;

@Entity
public class GuidanceQuestion extends Model {

	/**
	 * Attributes of Guidance Question
	 * 
	 * @author Mahmoud
	 **/

	public long userId;

	public String title;
	@Lob
	public String questionContent;
	public Date questionDate = new Date();

	public boolean hasReply = false; // to indicate color (green for answered &
										// red for unanswered)

	/**
	 * Guidance Question Initializer Constructor
	 * 
	 * @author Mahmoud
	 **/
	public GuidanceQuestion(long userId, String title, String questionContent) {

		this.userId = userId;
		this.title = title;
		this.questionContent = questionContent;
		this.questionDate = Calendar.getInstance().getTime();

	}

	/**
	 * This method gets the userId
	 * 
	 * @author Mahmoud
	 */
	public long getUserId() {
		return userId;
	}

	/**
	 * This method sets the userId
	 * 
	 * @author Mahmoud
	 * @param userId
	 */
	public void setUserId(long userId) {
		this.userId = userId;
	}

	/**
	 * This method gets the title
	 * 
	 * @author Mahmoud
	 */
	public String getTitle() {
		return title;
	}

	/**
	 * This method sets the title
	 * 
	 * @author Mahmoud
	 * @param title
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**
	 * This method gets the questionContent
	 * 
	 * @author Mahmoud
	 */
	public String getQuestionContent() {
		return questionContent;
	}

	/**
	 * This method sets the questionContent
	 * 
	 * @author Mahmoud
	 * @param questionContent
	 */
	public void setQuestionContent(String questionContent) {
		this.questionContent = questionContent;
	}

	/**
	 * This method gets the questionDate
	 * 
	 * @author Mahmoud
	 */
	public Date getQuestionDate() {
		return questionDate;
	}

	/**
	 * This method sets the questionDate
	 * 
	 * @author Mahmoud
	 * @param questionDate
	 */
	public void setQuestionDate(Date questionDate) {
		this.questionDate = questionDate;
	}

	/**
	 * This method sets the boolean variable hasReply
	 * 
	 * @author Mahmoud
	 */
	public boolean isHasReply() {
		return hasReply;
	}

	/**
	 * This method gets the boolean variable hasReply
	 * 
	 * @author Mahmoud
	 * @param hasReply
	 */
	public void setHasReply(boolean hasReply) {
		this.hasReply = hasReply;
	}

}